<?php

App::uses('AppModel', 'Model');

class CurrencyExchange extends AppModel {
    public $useTable = 'currency_exchange';
    public $order = 'CurrencyExchange.date DESC';
    
    public $validate = array(
        'date' => array(
            'rule'    => 'notEmpty',
            'message' => 'Morate odabrati datum.'
        ),
        'rate' => array(
            'rule'       =>  '/^\d+(\.\d+)?$/',
            'allowEmpty' => false,
            'message'    => 'Morate uneti validan kurs.'
        )
    );
}
